package com.bjx.system.domain.vo;

import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import com.bjx.api.system.domain.vo.DictDataVO;
import com.bjx.common.core.domain.group.Update;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.hibernate.validator.constraints.Range;

import javax.validation.Valid;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import java.util.Date;
import java.util.List;

/**
 * @desc: 字典类型视图
 * @author: liushuai
 * @date: 2022/8/15
 */

@Data
@AllArgsConstructor
@NoArgsConstructor
@Builder
@Schema(title = "DictTypeVO",description = "字典类型视图")
public class DictTypeVO {
    /**
     * 字典类型ID
     */
    @NotNull(groups = Update.class,message="字典类型ID不能为空")
    @Schema(title = "dictTypeId",description = "字典类型ID")
    private String dictTypeId;
    /**
     * 字典类型编号
     */
    @NotBlank(message = "字典类型编号不能为空")
    @Size(min = 1,max = 64,message = "字典类型编号长度为1到64个字符")
    @Schema(title = "dictTypeCode",description = "字典类型编号")
    private String dictTypeCode;
    /**
     * 字典类型名称
     */
    @NotBlank(message = "字典类型名称不能为空")
    @Size(min = 1,max = 64,message = "字典类型名称长度为1到64个字符")
    @Schema(title = "dictTypeName",description = "字典类型名称")
    private String dictTypeName;

    @Schema(title = "realName",description = "真实名称")
    private String realName;

    /**
     *  是否启用
     */
    @Range(message = "是否启用超出范围",min = 1,max = 2)
    @Schema(title = "enabled",description = "是否启用")
    private Short enabled;

    @Range(message = "序号",min = 1,max = 2147483647)
    @Schema(title = "orderNum",description = "序号")
    private Integer orderNum;

    /** 创建者 */
    @TableField(fill = FieldFill.INSERT)
    private Long createUser;

    /** 创建时间 */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @TableField(fill = FieldFill.INSERT)
    private Date createDate;

    @Valid
    @Schema(title = "dict",description = "字典值列表")
    private List<DictDataVO> dict;
    
}
